package moc.egg;
import moc.compiler.*;
import moc.tds.*;
import moc.type.*;
import moc.gc.*;
import java.util.*;
import mg.egg.eggc.runtime.libjava.lex.*;
import mg.egg.eggc.runtime.libjava.*;
import mg.egg.eggc.runtime.libjava.messages.*;
import mg.egg.eggc.runtime.libjava.problem.IProblem;
import java.util.Vector;
public class S_AX_MOC {
LEX_MOC scanner;
  S_AX_MOC() {
    }
  S_AX_MOC(LEX_MOC scanner, boolean eval) {
    this.scanner = scanner;
    this.att_eval = eval;
    this.att_scanner = scanner;
    }
int [] sync= new int[0];
  boolean att_gauche;
  boolean att_isAff;
  DTYPE att_stype;
  boolean att_eval;
  DTYPE att_htype;
  String att_code;
  IMachine att_machine;
  TDS att_tds;
  LEX_MOC att_scanner;
  private void regle33() throws Exception {

    //declaration
    S_OPREL_MOC x_2 = new S_OPREL_MOC(scanner,att_eval) ;
    S_R_MOC x_4 = new S_R_MOC(scanner,att_eval) ;
    //appel
if  (att_eval)      action_auto_inh_33(x_2, x_4);
    x_2.analyser() ;
if  (att_eval)      action_sens_33(x_2, x_4);
    x_4.analyser() ;
if  (att_eval)      action_type_33(x_2, x_4);
  }
  private void regle34() throws Exception {

    //declaration
    //appel
if  (att_eval)      action_type_34();
  }
private void action_type_34() throws Exception {
try {
// instructions
this.att_isAff=true;
this.att_stype=this.att_htype;
this.att_code="";
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#type","AX -> #type ;"});
}
  }
private void action_sens_33(S_OPREL_MOC x_2, S_R_MOC x_4) throws Exception {
try {
// instructions
x_4.att_gauche=false;
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#sens","AX -> OPREL #sens R #type ;"});
}
  }
private void action_type_33(S_OPREL_MOC x_2, S_R_MOC x_4) throws Exception {
try {
// instructions
if ((x_4.att_type.equals(this.att_htype)&&x_2.att_typesComp.contains(this.att_htype))){
this.att_stype= new INTEGERTYPE();
this.att_isAff=false;
this.att_code=x_4.att_code+this.att_machine.genOperation(x_2.att_op);
}
else {
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMOCMessages.id_Type_non_conformes, MOCMessages.Type_non_conformes,new Object[]{""+this.att_htype.toString(), ""+x_4.att_type.toString()});

}
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#type","AX -> OPREL #sens R #type ;"});
}
  }
private void action_auto_inh_33(S_OPREL_MOC x_2, S_R_MOC x_4) throws Exception {
try {
// instructions
x_4.att_tds=this.att_tds;
x_2.att_machine=this.att_machine;
x_4.att_machine=this.att_machine;
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#auto_inh","AX -> OPREL #sens R #type ;"});
}
  }
  public void analyser () throws Exception {
    scanner.lit ( 1 ) ;
    switch ( scanner.fenetre[0].code ) {
      case LEX_MOC.token_inf : // 49
        regle33 () ;
      break ;
      case LEX_MOC.token_sup : // 51
        regle33 () ;
      break ;
      case LEX_MOC.token_infeg : // 50
        regle33 () ;
      break ;
      case LEX_MOC.token_supeg : // 52
        regle33 () ;
      break ;
      case LEX_MOC.token_neg : // 54
        regle33 () ;
      break ;
      case LEX_MOC.token_eg : // 53
        regle33 () ;
      break ;
      case LEX_MOC.token_affect : // 38
        regle34 () ;
      break ;
      case LEX_MOC.token_virg : // 36
        regle34 () ;
      break ;
      case LEX_MOC.token_pv : // 37
        regle34 () ;
      break ;
      case LEX_MOC.token_parf : // 33
        regle34 () ;
      break ;
      case LEX_MOC.token_crf : // 67
        regle34 () ;
      break ;
      default :
               scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMOCMessages.id_MOC_unexpected_token,MOCMessages.MOC_unexpected_token,new String[]{scanner.fenetre[0].getNom()});
    }
  }
  }
